package com.spring.controller.asyncthread;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author: chenhs
 * @date: Created in 13:52 2019/8/4
 **/
@Component
public class MyAsyncThread {


    @Async
    public void run() {
        try {
            Thread.sleep(5000);
            System.out.print(new Date());
            System.out.println("执行完run方法....");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

}
